<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>改变构造函数属性的值</title>
</head>
<body>
	
<script>
	function A(){
		this.num1;
		
		this.init();
	}

	A.prototype = {
		constructor: A,

		init:function(){
			console.log("num1:",this.num1);

			this.add();
			this.reduce();
		},
		
		add:function(){
			this.num1 = 1;
			console.log("add num1:",this.num1);
		},

		reduce:function(){
			this.num1++;

			console.log("reduce num1:",this.num1);
		}
	}

	var test = new A();
	
</script>
</body>
</html>